package pw.goyd.game.logic;

import pw.goyd.protocol.core.Serializer;
import pw.goyd.subscribe.PlayerCustomer;

/**
 * 钻石兑换
 * Created by StanWind on 2016/11/4.
 */
public class ExchangeDiamondResponse extends Serializer {
    private int exchangeState;      //  兑换状态 0成功 1失败
    private PlayerCustomer player;  //  兑换的玩家

    public int getExchangeState() {
        return exchangeState;
    }

    public void setExchangeState(int exchangeState) {
        this.exchangeState = exchangeState;
    }

    public PlayerCustomer getPlayer() {
        return player;
    }

    public void setPlayer(PlayerCustomer player) {
        this.player = player;
    }

    @Override
    protected void read() {

    }

    @Override
    protected void write() {
        writeByte((byte) exchangeState);     //  兑换状态 是否成功
        writeInt(player.getGold());         //  兑换后金币
        writeInt(player.getDiamond());      //  兑换后钻石
    }
}
